function [s]=betapolyn(K,j,w)
%
% Beta weighting function in the MIDAS filter
%
j_vec=[(K-1):-1:1]';
N=ones(1,(K-1))*(1-j_vec/K).^(w-1);
s=(1-j/K).^(w-1)/N;